package com.dayuanit.dy15.ebook.bookshop.controller;

import com.dayuanit.dy15.ebook.bookshop.dto.ResponseDTO;
import com.dayuanit.dy15.ebook.bookshop.service.CommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CommodityController {


    @Autowired
    private CommodityService commodityService;

    @RequestMapping("/commodity/loadThirdNavCommos")
    public ResponseDTO loadThirdNavCommos(long thirdNavId) {
        return ResponseDTO.sucess(commodityService.loadCommondityByNavId(null, null, thirdNavId));
    }

    @RequestMapping("/commodity/loadBookDetail")
    public ResponseDTO loadBookDetail(long bookId) {
        return ResponseDTO.sucess(commodityService.loadBookDetail(bookId));
    }
}
